package org.acme.oauth2.client;

import com.github.tomakehurst.wiremock.http.QueryParameter;
import io.vertx.core.json.Json;
import io.vertx.core.json.JsonObject;
import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * @author LiJian
 * @date 2021/6/15 10:44
 */
@RegisterRestClient

public interface TdfOauth2Client {
    @POST
    @Path("/oauth/token")
    @ClientHeaderParam(name = "Accept",value="application/json")
    @Produces(MediaType.APPLICATION_JSON)
    String getAccessToken(@QueryParam("code") String code,
                              @QueryParam("grant_type") String grant_type,
                              @QueryParam("redirect_uri") String redirect_uri,
                              @HeaderParam("Authorization") String authorization);
    @POST
    @Path("/me")
    @ClientHeaderParam(name = "Accept",value="application/json")
    @Produces({MediaType.APPLICATION_JSON})
    String getUserMessage(@HeaderParam("Authorization") String authorization);

    @POST
    @Path("/exit")
    @ClientHeaderParam(name = "Accept",value="application/json")
    @Produces({MediaType.APPLICATION_JSON})
    String getExit(@HeaderParam("Authorization") String authorization);

}
